package com.dingli;

import com.spring4all.swagger.EnableSwagger2Doc;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author hpr
 * @date 2021/2/27 15:56
 */
@SpringBootApplication
@EnableSwagger2Doc
@MapperScan("com.dingli.framework.mapper")
public class MainApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(MainApplication.class);
        String port = context.getEnvironment().getProperty("server.port");
        try {
            System.out.println("=============================================");
            System.out.println("\thttp://" + InetAddress.getLocalHost().getHostAddress() + ":" + port + "/api/doc.html");
            System.out.println("=============================================");
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        //SpringApplication.run(MainApplication.class);
    }
}
